using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.IO;

namespace YPing
{
    public class HttpHelper
    {
        public static string GetContent(string url)
        {
            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();

            Stream resStream = response.GetResponseStream();
            if (response.ResponseUri != request.RequestUri)
            {
                return null;
            }

            StreamReader outputStream = new StreamReader(resStream);
            string value = outputStream.ReadToEnd();
            response.Close();

            return value;
        }
    }
}
